The present invention relates to a program, a method of detecting codes such as a one-dimensional bar code and a two dimensional code and an image forming apparatus equipped with a function to detect cods.
Many printed matters such as a magazine and a free paper in recent years are printed with two dimensional codes such as QR Code (registered trademark) in which URL (Uniform Resource Locator) information of shops and so on is recorded, and a user can receive a service to provide a discount ticket etc. by reading a two dimensional code with a photographing function of a mobile telephone and by accessing URL recorded on the two dimensional code with a network connecting function. However, for example, among mobile telephones in which functions are simplified in order to make operations easy and mobile telephones for a business use, there are some types of mobile telephones in which the photographing function is not installed. With these mobile telephones, a user using such a mobile cannot receive the above-mentioned service.
On the other hand, image forming apparatus equipped with a function capable of connecting with communication networks such as Internet become widely used. Since such image forming apparatus is installed in various places, a user using a mobile telephone not equipped with a photographing function can receive the above-mentioned service by scanning a free paper etc. with the image forming apparatus installed in a convenience store etc. and by extracting a two dimensional code (for example, refer to Japanese Patent Unexamined Publication No. 2004-227247). In this case, in order to extract the two dimensional code certainly, it is necessary to perform a suitable image processing by the image forming apparatus. As an example of such an image processing, for example, Japanese Patent Unexamined Publication No. 07-220081 discloses a technique with which image edges are extracted, two crossing straight lines are looked by Hough transform and least mean square approximation and a candidate region is determined.
Generally, as a method of extracting QR Code from a scan image, a method of looking for the “cut-out symbol” prepared in a corner of the QR Code by a pattern matching is used. However, since a region where QR Code is printed is not constant, pattern matching must be carried out to all the region of a scan image, and there is a problem that an image processing takes time.
When a scanning is conducted for a printed matter placed on a scanner, the printed matter may be set obliquely. Therefore, QR Code is not necessarily parallel or perpendicular to the image angle of a scan image. Accordingly, in order to extract the QR Code certainly, a pattern matching must be carried out at all angles and there is a problem that an image processing takes time more.
For such a problem, it may be considered to use the image processing method of the above-mentioned patent documents 1. However, in many cases, since image information, such as a photograph, is printed on a printed matter, such as a magazine and a free paper, a lot of edges exist in the image information. Therefore, a huge number of straight lines are extracted by the Hough transform, and, as a result, there is a problem that it is impossible to conduct analysis for the image information or an image processing takes huge time.
The present invention is conceived in view of the above-mentioned problem, and the first object of the present invention is to provide a code detecting program, a code detecting method, and an image forming apparatus which can detect simply and certainly a one-dimensional bar code or a two dimensional code from a printed matter, even in the case where a scanning is conducted obliquely to a printed matter in which text information and image information such as a photograph etc., are mixed.
Incidentally, when one code is printed on a printed matter, such as a magazine and a free paper, the code can be specified as a target of the processing by the image forming apparatus. However, usually, plural codes are printed on the above-mentioned printed matter, and, in such a case, it cannot be judged whether the image forming apparatus reads which code and conducts the processing.
Therefore, a user has to conduct a processes to fold a printed matter or a processes to hind an unnecessary code in order to make it possible for a scanner to read only a desired code. Accordingly, there are problems that works become complicated and a processing such as printing a discount ticket based on a code cannot be performed easily.
The present invention is also conceived in view of the above-mentioned problems, and the second object of the present invention is to provide a control program, a control method, and an image forming apparatus which can perform a processing by utilizing a desired code easily, even in the case where codes such as plural one-dimensional bar codes and two dimensional codes are printed on a printed matter.